Controller Strips
The 3D Viewer provides control elements for manipulating the location and orientation of the user's point of view (that is, of the view's camera).
Figure 7
shows a controller strip provided by the 3D Viewer.
Figure 7
The controller strip of the 3D Viewer
These controls are, from left to right:
-
The
camera viewpoint control.
This control allows the user to view the model from a different camera viewpoint. Holding down the camera viewpoint control causes a pop-up menu to appear, listing the available predefined direction cameras as well as any perspective (that is, aspect ratio) cameras stored in the view hints of the 3DMF data. If any such cameras in the data have name attributes associated with them, the names are displayed in the menu. Otherwise the cameras are listed as "Camera #1," "Camera #2," and so forth. (The predefined direction cameras are calculated based on the front and top custom attributes if present in the 3DMF view hints. Otherwise, the predefined camera directions are calculated from the model's coordinate space.) You control whether this pop-up menu is displayed using the
kQ3ViewerButtonCamera
viewer flag.
Only cameras of type
kQ3CameraTypeViewAngleAspect
are displayed in the camera viewpoint control's pop-up menu.
-
The
distance button.
This control allows the user to move closer to or farther away from the model. Clicking the distance button and then dragging the cursor downward in the picture area causes the displayed object to move closer. Dragging the cursor upward in the picture area causes the displayed object to move farther away. The up and down arrow keys cause the object to move farther or closer, respectively. You control whether this button is displayed using the
kQ3ViewerButtonTruck
flag.
-
The
rotate button.
This control allows the user to rotate an object. Clicking the rotate button and then dragging the cursor in the picture area causes the displayed object to rotate in the direction in which the cursor is dragged. The left and right arrow keys cause the object to rotate left and right. The up and down arrow keys cause the object to rotate up and down, respectively. You control whether this button is displayed using the
kQ3ViewerButtonOrbit
flag.
-
The
zoom button.
This control allows the user to alter the field of view of the current camera, thereby zooming in or out on the object in the model. The up and down arrow keys cause the object to zoom out and in. This button is not displayed by default. You control whether this button is displayed using the
kQ3ViewerButtonZoom
flag
-
The
move button.
This control allows the user to move an object. Clicking the move button and then dragging on the object in the picture area causes the object to be moved to a new location. The up, down, left, and right arrow keys cause the object to move up, down, left, or right, respectively. You control whether this button is displayed using the
kQ3ViewerButtonDolly
flag.
-
The
reset button.
This pushbutton resets the camera viewpoint to its initial setting. You control whether this button is displayed using the
kQ3ViewerButtonReset
flag.
Your application controls which of these buttons are displayed in a viewer object's controller strip at the time you create the viewer object, or by appropriately setting a viewer's flags. See
Listing 14
for an example of setting a viewer's flags.
© 1997 Apple Computer, Inc.
Previous | QD3D Book | Overview | Chapter Contents | Next |